package com.sczmgk.hotline_pzh.utils;

import org.json.JSONException;
import org.json.JSONObject;


public class SerJson {

	public static String getJson(String name,String value){
		JSONObject jsonObject = new JSONObject();
		try {
			jsonObject.put(name, value);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}
	public static String getContextJson(String imei,String imsi,String userid){
		String imeijson = getJson("imei", imei);
		String imsijson = getJson("imei", imsi);
		String useridjson = getJson("userid", userid);
		StringBuilder sb = new StringBuilder();
		sb.append(imeijson);
		sb.append(",");
		sb.append(imsijson);
		sb.append(",");
		sb.append(useridjson);
		JSONObject jsonObject = new JSONObject();
		try {
			JSONObject put = jsonObject.put("context", sb.toString());
			return put.toString();
			
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}
}
